package icu.qx.qc.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import icu.qx.qc.mapper.QcDrawbackTypeMapper;
import icu.qx.qc.domain.QcDrawbackType;
import icu.qx.qc.service.IQcDrawbackTypeService;

/**
 * 缺陷类型Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-06-11
 */
@Service
public class QcDrawbackTypeServiceImpl implements IQcDrawbackTypeService 
{
    @Autowired
    private QcDrawbackTypeMapper qcDrawbackTypeMapper;

    /**
     * 查询缺陷类型
     * 
     * @param drawbackTypeCode 缺陷类型主键
     * @return 缺陷类型
     */
    @Override
    public QcDrawbackType selectQcDrawbackTypeByDrawbackTypeCode(String drawbackTypeCode)
    {
        return qcDrawbackTypeMapper.selectQcDrawbackTypeByDrawbackTypeCode(drawbackTypeCode);
    }

    /**
     * 查询缺陷类型列表
     * 
     * @param qcDrawbackType 缺陷类型
     * @return 缺陷类型
     */
    @Override
    public List<QcDrawbackType> selectQcDrawbackTypeList(QcDrawbackType qcDrawbackType)
    {
        return qcDrawbackTypeMapper.selectQcDrawbackTypeList(qcDrawbackType);
    }

    /**
     * 新增缺陷类型
     * 
     * @param qcDrawbackType 缺陷类型
     * @return 结果
     */
    @Override
    public int insertQcDrawbackType(QcDrawbackType qcDrawbackType)
    {
        qcDrawbackType.setCreateTime(DateUtils.getNowDate());
        return qcDrawbackTypeMapper.insertQcDrawbackType(qcDrawbackType);
    }

    /**
     * 修改缺陷类型
     * 
     * @param qcDrawbackType 缺陷类型
     * @return 结果
     */
    @Override
    public int updateQcDrawbackType(QcDrawbackType qcDrawbackType)
    {
        qcDrawbackType.setUpdateTime(DateUtils.getNowDate());
        return qcDrawbackTypeMapper.updateQcDrawbackType(qcDrawbackType);
    }

    /**
     * 批量删除缺陷类型
     * 
     * @param drawbackTypeCodes 需要删除的缺陷类型主键
     * @return 结果
     */
    @Override
    public int deleteQcDrawbackTypeByDrawbackTypeCodes(String[] drawbackTypeCodes)
    {
        return qcDrawbackTypeMapper.deleteQcDrawbackTypeByDrawbackTypeCodes(drawbackTypeCodes);
    }

    /**
     * 删除缺陷类型信息
     * 
     * @param drawbackTypeCode 缺陷类型主键
     * @return 结果
     */
    @Override
    public int deleteQcDrawbackTypeByDrawbackTypeCode(String drawbackTypeCode)
    {
        return qcDrawbackTypeMapper.deleteQcDrawbackTypeByDrawbackTypeCode(drawbackTypeCode);
    }
}
